
* ------------------------------------------------------------------------
*   	CPI, PCE, PPI
* ------------------------------------------------------------------------

* CPI data from http://data.bls.gov/cgi-bin/surveymost?cu
* Selected all items
* Data extracted on: June 11, 2010 (3:08:28 PM)
* Updated on Nov 17, 2020 (until 2019)

gen cpi=.
replace cpi=    172.2/  29.9		if year == 	1961     
replace cpi=	172.2/	30.2		if year ==	1962	 
replace cpi=	172.2/	30.6		if year ==	1963	 
replace cpi=	172.2/	31			if year ==	1964	 
replace cpi=	172.2/	31.5		if year ==	1965	 
replace cpi=	172.2/	32.4		if year ==	1966	 
replace cpi=	172.2/	33.4		if year ==	1967	 
replace cpi=	172.2/	34.8		if year ==	1968	 
replace cpi=	172.2/	36.7		if year ==	1969	 
replace cpi=	172.2/	38.8		if year ==	1970	 
replace cpi=	172.2/	40.5		if year ==	1971	 
replace cpi=	172.2/	41.8		if year ==	1972	 
replace cpi=	172.2/	44.4		if year ==	1973	 
replace cpi=	172.2/	49.3		if year ==	1974	 
replace cpi=	172.2/	53.8		if year ==	1975	 
replace cpi=	172.2/	56.9		if year ==	1976	 
replace cpi=	172.2/	60.6		if year ==	1977	 
replace cpi=	172.2/	65.2		if year ==	1978	 
replace cpi=	172.2/	72.6		if year ==	1979	 
replace cpi=	172.2/	82.4		if year ==	1980	 
replace cpi=	172.2/	90.9		if year ==	1981	 
replace cpi=	172.2/	96.5		if year ==	1982	 
replace cpi=	172.2/	99.6		if year ==	1983	 
replace cpi=	172.2/	103.9		if year ==	1984	 
replace cpi=	172.2/	107.6		if year ==	1985	 
replace cpi=	172.2/	109.6		if year ==	1986	 
replace cpi=	172.2/	113.6		if year ==	1987	 
replace cpi=	172.2/	118.3		if year ==	1988	 
replace cpi=	172.2/	124			if year ==	1989	 
replace cpi=	172.2/	130.7		if year ==	1990	 
replace cpi=	172.2/	136.2		if year ==	1991	 
replace cpi=	172.2/	140.3		if year ==	1992	 
replace cpi=	172.2/	144.5		if year ==	1993	 
replace cpi=	172.2/	148.2		if year ==	1994	 
replace cpi=	172.2/	152.4		if year ==	1995	 
replace cpi=	172.2/	156.9		if year ==	1996	 
replace cpi=	172.2/	160.5		if year ==	1997	 
replace cpi=	172.2/	163			if year ==	1998	 
replace cpi=	172.2/	166.6		if year ==	1999	 
replace cpi=	172.2/	172.2		if year ==	2000	 
replace cpi=	172.2/	177.1		if year ==	2001	 
replace cpi=	172.2/	179.9		if year ==	2002	 
replace cpi=	172.2/	184			if year ==	2003	 
replace cpi=	172.2/	188.9		if year ==	2004	 
replace cpi=	172.2/	195.3		if year ==	2005	 
replace cpi=	172.2/	201.6		if year ==	2006	 
replace cpi=	172.2/	207.342		if year ==	2007	 
replace cpi=	172.2/	215.303		if year ==	2008	 
replace cpi=	172.2/	214.537		if year ==	2009	 
replace cpi=	172.2/  218.056		if year ==	2010	 
replace cpi=	172.2/	224.939		if year ==	2011	 
replace cpi=	172.2/	229.594 	if year ==	2012
replace cpi=	172.2/	232.957		if year ==	2013
replace cpi=	172.2/	236.736		if year ==	2014
replace cpi=	172.2/	237.017		if year ==	2015
replace cpi=	172.2/	240.007		if year ==	2016
replace cpi=	172.2/	245.120		if year ==	2017
replace cpi=	172.2/	251.107 	if year ==	2018
replace cpi=	172.2/	255.657 	if year ==	2019
	
	
	
* 	Common cut offs refer to 1979 prices (ex, KM92, Lemieux2006)
*	so gen cpi79
gen cpi79 = cpi*72.6/172.2

*	PCE
*	figures taken from http://research.stlouisfed.org/fred2/data/PCECTPI.txt
* 		Title:               Personal Consumption Expenditures: Chain-type Price Index
*		Series ID:           PCECTPI
*		Source:              U.S. Department of Commerce: Bureau of Economic Analysis
*		Release:             Gross Domestic Product

gen pce=.
replace pce=	89.78/	18.8	if year==	1961	 
replace pce=	89.78/	19.02	if year==	1962	 
replace pce=	89.78/	19.25	if year==	1963	 
replace pce=	89.78/	19.53	if year==	1964	 
replace pce=	89.78/	19.81	if year==	1965	 
replace pce=	89.78/	20.31	if year==	1966	 
replace pce=	89.78/	20.83	if year==	1967	 
replace pce=	89.78/	21.64	if year==	1968	 
replace pce=	89.78/	22.62	if year==	1969	 
replace pce=	89.78/	23.68	if year==	1970	 
replace pce=	89.78/	24.68	if year==	1971	 
replace pce=	89.78/	25.53	if year==	1972	 
replace pce=	89.78/	26.9	if year==	1973	 
replace pce=	89.78/	29.71	if year==	1974	 
replace pce=	89.78/	32.19	if year==	1975	 
replace pce=	89.78/	33.95	if year==	1976	 
replace pce=	89.78/	36.16	if year==	1977	 
replace pce=	89.78/	38.69	if year==	1978	 
replace pce=	89.78/	42.12	if year==	1979	 
replace pce=	89.78/	46.64	if year==	1980	 
replace pce=	89.78/	50.81	if year==	1981	 
replace pce=	89.78/	53.62	if year==	1982	 
replace pce=	89.78/	55.92	if year==	1983	 
replace pce=	89.78/	58.04	if year==	1984	 
replace pce=	89.78/	59.94	if year==	1985	 
replace pce=	89.78/	61.4	if year==	1986	 
replace pce=	89.78/	63.59	if year==	1987	 
replace pce=	89.78/	66.12	if year==	1988	 
replace pce=	89.78/	69		if year==	1989	 
replace pce=	89.78/	72.15	if year==	1990	 
replace pce=	89.78/	74.76	if year==	1991	 
replace pce=	89.78/	76.96	if year==	1992	 
replace pce=	89.78/	78.65	if year==	1993	 
replace pce=	89.78/	80.27	if year==	1994	 
replace pce=	89.78/	82.04	if year==	1995	 
replace pce=	89.78/	83.83	if year==	1996	 
replace pce=	89.78/	85.39	if year==	1997	 
replace pce=	89.78/	86.21	if year==	1998	 
replace pce=	89.78/	87.6	if year==	1999	 
replace pce=	89.78/	89.78	if year==	2000	 
replace pce=	89.78/	91.49	if year==	2001	 
replace pce=	89.78/	92.74	if year==	2002	 
replace pce=	89.78/	94.62	if year==	2003	 
replace pce=	89.78/	97.1	if year==	2004	 
replace pce=	89.78/	100		if year==	2005	 
replace pce=	89.78/	102.75	if year==	2006	 
replace pce=	89.78/	105.5	if year==	2007	 
replace pce=	89.78/	109.03	if year==	2008	 
replace pce=	89.78/	109.24	if year==	2009	 
replace pce=	89.78/	110.6	if year==	2010	 
replace pce=	89.78/	((112.747 + 113.666 +  114.324 +114.657)/4)	if year==	2011	 
*replace pce=	89.78/	((112.747 + 113.666 +  114.324 +114.657)/4)	if year==	2012	 


* common cuttoffs expressed in 1982 dollars (ex, JMP)
gen pce82 = pce/89.78*53.62

// PPI 
gen ppi=.
replace ppi =	132.70	/	31.7	if year ==	1960	 
replace ppi =	132.70	/	31.6	if year ==	1961	 
replace ppi =	132.70	/	31.7	if year ==	1962	 
replace ppi =	132.70	/	31.6	if year ==	1963	 
replace ppi =	132.70	/	31.6	if year ==	1964	 
replace ppi =	132.70	/	32.3	if year ==	1965	 
replace ppi =	132.70	/	33.3	if year ==	1966	 
replace ppi =	132.70	/	33.4	if year ==	1967	 
replace ppi =	132.70	/	34.2	if year ==	1968	 
replace ppi =	132.70	/	35.6	if year ==	1969	 
replace ppi =	132.70	/	36.9	if year ==	1970	 
replace ppi =	132.70	/	38.1	if year ==	1971	 
replace ppi =	132.70	/	39.8	if year ==	1972	 
replace ppi =	132.70	/	45.0	if year ==	1973	 
replace ppi =	132.70	/	53.5	if year ==	1974	 
replace ppi =	132.70	/	58.4	if year ==	1975	 
replace ppi =	132.70	/	61.1	if year ==	1976	 
replace ppi =	132.70	/	64.9	if year ==	1977	 
replace ppi =	132.70	/	69.9	if year ==	1978	 
replace ppi =	132.70	/	78.7	if year ==	1979	 
replace ppi =	132.70	/	89.8	if year ==	1980	 
replace ppi =	132.70	/	98.0	if year ==	1981	 
replace ppi =	132.70	/	100.0	if year ==	1982	 
replace ppi =	132.70	/	101.3	if year ==	1983	 
replace ppi =	132.70	/	103.7	if year ==	1984	 
replace ppi =	132.70	/	103.2	if year ==	1985	 
replace ppi =	132.70	/	100.2	if year ==	1986	 
replace ppi =	132.70	/	102.8	if year ==	1987	 
replace ppi =	132.70	/	106.9	if year ==	1988	 
replace ppi =	132.70	/	112.2	if year ==	1989	 
replace ppi =	132.70	/	116.3	if year ==	1990	 
replace ppi =	132.70	/	116.5	if year ==	1991	 
replace ppi =	132.70	/	117.2	if year ==	1992	 
replace ppi =	132.70	/	118.9	if year ==	1993	 
replace ppi =	132.70	/	120.5	if year ==	1994	 
replace ppi =	132.70	/	124.8	if year ==	1995	 
replace ppi =	132.70	/	127.7	if year ==	1996	 
replace ppi =	132.70	/	127.6	if year ==	1997	 
replace ppi =	132.70	/	124.4	if year ==	1998	 
replace ppi =	132.70	/	125.5	if year ==	1999	 
replace ppi =	132.70	/	132.7	if year ==	2000	 
replace ppi =	132.70	/	134.2	if year ==	2001	 
replace ppi =	132.70	/	131.1	if year ==	2002	 
replace ppi =	132.70	/	138.1	if year ==	2003	 
replace ppi =	132.70	/	146.7	if year ==	2004	 
replace ppi =	132.70	/	157.4	if year ==	2005	 
replace ppi =	132.70	/	164.8	if year ==	2006	 
replace ppi =	132.70	/	172.7	if year ==	2007	 
replace ppi =	132.70	/	189.6	if year ==	2008	 
replace ppi =	132.70	/	172.9	if year ==	2009	 
replace ppi =	132.70	/	184.7	if year ==	2010	 
replace ppi =	132.70	/	201.1	if year ==	2011	 
